package com.sright.bcard.user.dal.mapper;

import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.common.service.share.dto.request.VisitorPageRequest;
import com.sright.bcard.user.dal.entity.VisitorDO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface VisitorMapper extends BaseMapper<VisitorDO> {
    int deleteByPrimaryKey(Long id);

    List<VisitorDO> selectByEnterpriseId(@Param("enterpriseId") Long enterpriseId);

    List<VisitorDO> selectByEnterpriseIdAndMemberId(@Param("enterpriseId") Long enterpriseId, @Param("visitorMemberId") Long visitorMemberId);

    Integer getVisitTotalByEnterpriseIdAndMemberId(@Param("enterpriseId") Long enterpriseId, @Param("visitorMemberId") Long visitorMemberId);

    VisitorDO selectByUserIdAndCardId(@Param("cardUserId") Long cardUserId, @Param("memberId") Long memberId);

    VisitorDO selectByMmeberIdOrderTime(Long memberId);

    Integer selectSum(@Param("userId") Long userId, @Param("memberId") Long memberId);

    List<VisitorDO> selectPageData(@Param("paramRequest") PageParamRequest paramRequest, @Param("userId") Long userId, @Param("order") String order, @Param("memberId") Long memberId);

    Integer selectCount(Long userId);

    Integer selectCountBetweenDate(@Param("userId") Long userId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    List<VisitorDO> selectAllData(@Param("userId") Long userId, @Param("memberId") Long memberId);

    Integer selectSumTotalByEnterpriseId(@Param("enterpriseId") Long enterpriseId);
}